import request from '@/src/basic/utils/request.js'
import { getUserInfo } from '@/src/basic/utils/user'

function handleParams(param) {
  let paramsUrl = ''
  for (const item in param) {
    let val = param[item]
    let str = `${item}=${val}&`
    paramsUrl += str
  }
  paramsUrl = paramsUrl.slice(0, paramsUrl.length - 1)
  return paramsUrl
}

export const getBusinessType = async params => {
  const mcType = {
    mcType: 1
  }
  const { data } = await request.post(
    `/merchant/mcManagementType/businessType?${handleParams({ ...params, ...mcType })}`
  )
  return data
}

// 提交审批资料
export const submitShopInformation = async params => {
  const { data } = await request.post('/merchant/app/store/submitShopInformation', params)
  return data
}

